package com.ft.core.exceptions.inner;

import com.ft.core.exceptions.ExceptionConstant;
import com.ft.core.exceptions.ExceptionLevel;
import lombok.Getter;
import lombok.Setter;

/**
 * @copyright (C), 2015-2019, 梵途科技有限公司
 * @fileName: FanTuException
 * @author: 李阳
 * @date: 2019/4/17 10:56
 * @description: 内部基异常
 */
public class FanTuException extends RuntimeException implements ExceptionConstant {
    private static final long serialVersionUID = -2107296174087869040L;

    /**
     * 无构造实例化
     */
    public FanTuException() {
        super();
    }

    /**
     * 实例化
     *
     * @param message 消息
     */
    public FanTuException(String message) {
        super(message);
    }

    /**
     * 实例化
     *
     * @param message 消息
     * @param cause   源异常
     */
    public FanTuException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * 实例化
     *
     * @param cause 源异常
     */
    public FanTuException(Throwable cause) {
        super(cause);
    }

    /**
     * 实例化
     *
     * @param message            消息
     * @param cause              源异常
     * @param enableSuppression
     * @param writableStackTrace 写入跟踪
     */
    protected FanTuException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    @Getter
    @Setter
    private int code;

    @Getter
    @Setter
    private ExceptionLevel level = ExceptionLevel.NONE;
}
